home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlb20
/
lib
/
link.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-06
|
485b
|
35 lines
/* make a hard link */
#include <errno.h>
#include <mintbind.h>
#include <param.h>
#include "lib.h"
extern int __mint;
/*
* if MiNT is not active, we try to fail gracefully
*/
int
link(_old, _new)
char *_old, *_new;
{
long r;
char old[MAXPATHLEN], new[MAXPATHLEN];
if (__mint < 9) {
errno = EXDEV;
return -1;
}
_unx2dos(_old, old);
_unx2dos(_new, new);
r = Flink(old, new);
if (r < 0) {
errno = -r;
return -1;
}
return 0;
}